const likeService = require('../service/like.service')

class likeController {
    async create(ctx, next) {
        const { postId } = ctx.query
        const { id } = ctx.user
        const result = await likeService.create(postId, id)
        ctx.body = result
    }

    async remove(ctx, next) {
        const { postId } = ctx.query
        const { id } = ctx.user
        console.log('postId',postId, id)

        const result = await likeService.detele(postId, id)
        ctx.body = result
    }
}

module.exports = new likeController()
